﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>凉山州中考志愿填报</title>
<link rel="stylesheet" href="/css/newStyle.css"
	th:href="@{/css/newStyle.css}">
<link rel="stylesheet" type="text/css" href="/css/bwyStyle.css"
	th:href="@{/css/bwyStyle.css}" />
</head>
<body>
	<div class="mainBox" th:object="${student}">
		<div class="mainBox_inner student_inner">
			<h1>凉山州中考志愿填报系统(学生端)</h1>
			<p class="tips" style="text-align: center;">本批次填报时间限制为：2019年6月24日8时-----2019年6月27日18时
			
			<p>
			<div>
				<div class="clearfix studentInfo_header">
					<p class="fl" th:text="'姓名： ' + ${student.xm} ">
						姓名：<span id='name'></span>
					</p>
					<p class="fl" id="bmh2" th:value="${student.bmh}"
						th:text="'报名号： ' + ${student.bmh} ">
						报名号：<span id='bmh'></span>
					</p>
					<font color='red'><span class="tips">修改志愿后一定要提交保存，否则操作无效;先选学校后选专业</span></font>
					<form id="form1" action="xx"  method="post">
					<div class="fr">
						<!--修改密码 跳页面-->
						<input type="button" class="loginOut"  onclick="javascript:history.go(-1);" value="返回上级">
						<button id="updataPassword" class="loginOut" onclick="is_submit(1)">修改密码</button>
						<button id="loginOut" class="loginOut" onclick="is_submit(2)">安全退出</button>
					</div>
					</form>
				</div>
				<div class="studentInfo_body">
					<form id="ami_form" action="wish" th:action="@{/wish}"
						th:object="${wishAll}" method="post">
						<div class="first_ami" th:object="${highSchoolWish}">
							<h3>第一批次志愿：</h3>
							<!--<span class="tips">本特色项目与艺体只能二选一</span>-->
							 
							<div class="teseClass">
	                        <span>特色项目及艺体特长班志愿填报：</span></br>
	                        <span style="color:red">(仅供已通过学校审核并参加了专业考试的学生填报，其他考生填报均无效)</span></br>
								<!--disabled表示禁用-->
								<select id="tsxmschool" name="teschool"
									class="choceSchool choceSchool1 csd choceSchool2">
									<option value="">--请选择特色项目学校--</option>
									<!--这一行留着，JS需要-->
									<option th:if="${highSchoolWish==null or highSchoolWish.gzy10 == null}"
										th:each="school:${wishAll.wishOne.featuredItems}"
										th:value="${school.xxdm}" th:text="${school.xxmc}"
										th:filed="${school.xxdm}"></option>
									<option th:unless="${highSchoolWish ==null or highSchoolWish.gzy10 == null}"
										th:each="school:${wishAll.wishOne.featuredItems}" th:selected="(${highSchoolWish.gzy10==school.xxdm})" th:value="${school.xxdm}" th:text="${school.xxmc}"
										th:filed="${school.xxdm}"></option>
								</select> 
								<select id="tsxmzy" name="tsxmzy"
									class="choceMajor choceMajorts ts" disabled = "disabled">
									<option value="">--选择特色项目--</option>
									<option th:if="${highSchoolWish==null or highSchoolWish.gtszy == null}" th:each="specialty:${wishAll.wishOne.featuredItems}"
										th:value="${specialty.tsxmdm}" th:text="${specialty.tsxmmc}"></option>
									<option th:if="${highSchoolWish!=null and highSchoolWish.gtszy != null}" th:each="specialty:${wishAll.wishOne.featuredItems}"
										th:value="${specialty.tsxmdm}" th:text="${specialty.tsxmmc}" th:selected="(${highSchoolWish.gtszy==specialty.tsxmdm})"></option>										
								</select> <br><br>
								<div>
									<select id="yttcschool" name="teschool"
										class="choceSchool choceSchool1 csd choceSchool3">
										<option value="">--请选择艺体特长学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy11 == null}"
											th:each="school:${wishAll.wishOne.specialtyOfArts}"
											th:value="${school.xxdm}" th:text="${school.xxmc}"
											th:filed="${school.xxdm}"></option>
										<option th:unless="${highSchoolWish ==null or highSchoolWish.gzy11 == null}"
											th:each="school:${wishAll.wishOne.specialtyOfArts}" th:selected="(${highSchoolWish.gzy11==school.xxdm})" th:value="${school.xxdm}" th:text="${school.xxmc}"
											th:filed="${school.xxdm}"></option>
									</select>
									<select id="yttczy" name="yttczy"
										class="choceMajor choceMajoryt yt" disabled = "disabled">
										<option value="">--选择艺体特长--</option>
										<option th:if="${highSchoolWish==null or highSchoolWish.gytzy == null}"
											th:each="artSpecialty:${wishAll.wishOne.specialtyOfArts}"
											th:value="${artSpecialty.yttcdm}"
											th:text="${artSpecialty.yttcmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gytzy != null}" th:each="artSpecialty:${wishAll.wishOne.specialtyOfArts}"
											th:value="${artSpecialty.yttcdm}" th:text="${artSpecialty.yttcmc}" th:selected="(${highSchoolWish.gytzy==artSpecialty.yttcdm})"></option>
									</select>
								</div>
								
							</div>
							<div>
								<span>一类模式志愿填报：</span> <br>
								<select id="yltzxx" name=""	class="choceSchool csd">
									<option value="">--选择学校--</option>
									<option th:if="${highSchoolWish==null or highSchoolWish.gylzy == null}" th:each="oneClass:${wishAll.wishOne.oneClassOfSystems}"
										th:value="${oneClass.xxdm}" th:text="${oneClass.xxmc}"
										th:filed="${oneClass.xxdm}">成都1中</option>
									<option th:if="${highSchoolWish!=null and highSchoolWish.gylzy != null}" th:each="oneClass:${wishAll.wishOne.oneClassOfSystems}"
										th:value="${oneClass.xxdm}" th:text="${oneClass.xxmc}"
										th:filed="${oneClass.xxdm}" th:selected="(${highSchoolWish.gylzy==oneClass.xxdm})">成都1中</option>										
								</select>

							</div>
						</div>
						<div class="second_ami">
							<h3>第二批次志愿（省州示范性高中学校）：请选择四个平行志愿</h3>
							<!-- <span class="tips">本批次填报时间限制为2018年6月25-27日</span> -->
							<!--bwy-->
							<i class="checkrepeat21"> 志愿学校重复。 </i>
							<!--bwy-->
							<div class="pxzyBox">
								<div class="vol_a">
									<p>志愿A</p>
									<select id="second1" name="" class="zhiyuan choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy21 == null }" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}" th:filed="${school2.xxdm}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy21 != null}"
                                                th:each="school2:${wishAll.wishTwo.hsList}" th:selected="(${highSchoolWish.gzy21==school2.xxdm})"th:value="${school2.xxdm}" th:text="${school2.xxmc}"
                                            th:filed="${school2.xxdm}"  ></option>
										<option value="" style="display: none;" >不可用</option>										
									</select>
								</div>
								<div class="vol_a">
									<p>志愿B</p>
									<select id="second2" name="" class="zhiyuan choceSchool">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy22 == null }" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy22 != null}" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}" th:selected="(${highSchoolWish.gzy22==school2.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
								<div class="vol_a">
									<p>志愿C</p>
									<select id="second3" name="" class="zhiyuan choceSchool">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy23 == null}" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy23 != null}" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}" th:selected="(${highSchoolWish.gzy23==school2.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
								<div class="vol_a">
									<p>志愿D</p>
									<select id="second4" name="" class="zhiyuan choceSchool">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy24 == null}" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy24 != null}" th:each="school2:${wishAll.wishTwo.hsList}"
											th:value="${school2.xxdm}" th:text="${school2.xxmc}" th:selected="(${highSchoolWish.gzy24==school2.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
							</div>

						</div>
						<div class="third_ami">
							<h3>第三批次志愿：请选择四个平行志愿（一般普通高中和民办高中政府购买学位）</h3>
							<!--<span class="tips">本批次填报时间限制为2018年6月25-27日</span>-->
							<!--bwy-->
							<i class="checkrepeat31"> 志愿学校重复。 </i>
							<!--bwy-->
							<div class="pxzyBox">
								<div class="vol_a">
									<p>志愿A</p>
									<select id="third1" name="" class="zhiyuan choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy31 == null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy31 != null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}" th:selected="(${highSchoolWish.gzy31==school3.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
								<div class="vol_a">
									<p>志愿B</p>
									<select id="third2" name="" class="zhiyuan choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy32 == null }" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy32 != null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}" th:selected="(${highSchoolWish.gzy32==school3.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
								<div class="vol_a">
									<p>志愿C</p>
									<select id="third3" name="" class="zhiyuan choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy33 == null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy33 != null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}" th:selected="(${highSchoolWish.gzy33==school3.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
								<div class="vol_a">
									<p>志愿D</p>
									<select id="third4" name="" class="zhiyuan choceSchool csd">
										<option value="">--选择学校--</option>
										<!--这一行留着，JS需要-->
										<option th:if="${highSchoolWish==null or highSchoolWish.gzy34 == null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}"></option>
										<option th:if="${highSchoolWish!=null and highSchoolWish.gzy34 != null}" th:each="school3:${wishAll.wishThree.hsList}"
											th:value="${school3.xxdm}" th:text="${school3.xxmc}" th:selected="(${highSchoolWish.gzy34==school3.xxdm})"></option>											
										<option value="" style="display: none;">不可用</option>
									</select>
								</div>
							</div>


						</div>
						<div>
							<button type="button" id="uploadInfo" class="btnclass">提交</button>
						</div>
					</form>
				</div>

			</div>
		</div>
	</div>

</body>
<script src="js/jquery-1.12.3.js"></script>
<script src="js/gVerify.js"></script>
<script src="js/commen.js"></script>
<script>
	/*中间部分为布文玉添加*/
	
	$(".choceMajoryt").on("click",function(){
		console.log($(".choceSchool3").val());
		if ($(".choceSchool3").val() == ""){
			 $(this).attr("disabled","disabled");
			alert("请先选择学校");
		}else {
			$(this).prop("disabled",false);
		}
	})
	$(".choceMajorts").on("click",function(){
		console.log($(".choceSchool2").val());
		if ($(".choceSchool2").val() == ""){
			 $(this).attr("disabled","disabled");
			alert("请先选择学校");
		}else {
			$(this).prop("disabled",false);
		}
	})
	$(".choceSchool1").on("change",function(){
		var _this = this;
		var thisId = $(_this).val();
		if (thisId != ""){
			$(_this).siblings().prop("disabled",false);
		}
	})
		
	
	//获取url
	function Geturl() {
		var url = location.search; //获取url中"?"符后的字串   
		//		   console.log(url);
		var theRequest = new Object();
		if (url.indexOf("?") != -1) {
			var str = url.substr('1');
			strs = str.split("&");
			for (var i = 0; i < strs.length; i++) {
				theRequest[strs[i].split("=")[0]] = decodeURI(strs[i]
						.split("=")[1]);
			}
		}
		return theRequest;
	}
	//设置姓名和报名号
	var RequestUrl = Geturl();
	$("#name").text(RequestUrl.name);
	//console.log($("#bmh").text(RequestUrl.bmh));
	$("#bmh").text(RequestUrl.bmh);

	//第二批志愿里面可填写志愿数和可选学校数一样
	var size_option = $("#second1 option").size(); //获取可选学校有几个
	var size_select = $(".second_ami .zhiyuan").size(); //获取有几个select
	var num_cha = size_option - size_select //算出差值
	var num_cha1 = size_select - size_option //算出差值
	//		console.log(num_cha);
	//		console.log(size_select);
	//		console.log(size_option);
	if (num_cha < 2) {
		for (var i = size_option - 2; i < size_select; i++) {
			//给后面的select标签添加disabled属性，我现在怎么找到select标签呢

			/* $(".second_ami .zhiyuan").eq(i).addClass("d");
			$(".second_ami .zhiyuan").eq(i).attr("disabled", "disabled"); */
			$(".second_ami .zhiyuan").eq(i).val(i + 1000);
		}

	}

	//第三批志愿里面可填写志愿数和可和可选学校数一样
	var size_option_third = $("#third1 option").size(); //获取可选学校有几个
	var size_select_third = $(".third_ami .zhiyuan").size(); //获取有几个select
	var num_cha_third = size_option_third - size_select_third //算出差值
	var num_cha1_third = size_select_third - size_option_third //算出差值
	//		console.log(num_cha);console.log(size_select_third);console.log(size_option_third);
	if (num_cha_third < 2) {
		for (var i = size_option_third - 2; i < size_select_third; i++) {
			/* $(".third_ami .zhiyuan").eq(i).addClass("d");
			$(".third_ami .zhiyuan").eq(i).attr("disabled", "disabled"); */
			$(".third_ami .zhiyuan").eq(i).val(i + 1000);
		}

	}
	
	// add by chenyj 2018/05/21  安全退出和修改密码跳转
    function is_submit(value) {
        var form1 = $("#quit");
        if (value == 1) {          
            var id = $("#id").val();
            form1.action = "goChangePasswd";
             $("#form1").attr("action",form1.action);
            form1.submit();
        }
        if (value == 2) {
            form1.action = "loginOut";
            $("#form1").attr("action", form1.action);
            form1.submit();
        }
    }
	
    /*
	$('#loginOut').on('click',function(){
		var form = document.getElementById('quit');
		//再次修改input内容
		form.submit();
	})
	*/
	
	
	/*
	//退出按钮
	$('#loginOut').on('click', function() {
		alert("安全退出");
		$.ajax({
			type : "post",
			url : "loginOut",//提交的地址
			//data:$("#ami_form").serialize(),
			data : {},
			dataType : "json",
			success : function(data) {
				console.log(data);
				alert("提交成功")
				//看一下data返回是否成功，成功在话弹提交成功，反之失败
				 //window.location.href="/index";
				 location.href="";
			},
			error : function(error) {
				//提交失败
				console.log(error);
				alert("提交失败")
			}
		})
	})
	*/

		
	//点击提交时，判断是否可以提交
	$('#uploadInfo').on(
			'click',
			function() {
				//			console.log($(".choceSchool1 option:selected").val());console.log($(".choceMajorts option:selected").val());console.log($(".choceMajoryt option:selected").val());
				/*第一批志愿选择学校后，必须选择一个专业*/
				if ($("#tsxmschool option:selected").val() != ""
						&&$(".choceMajorts option:selected").val() == "")
						{
						alert("第一批志愿选择学校后至少选择一个专业！");
					return false; 
						}

				if ($("#yttcschool option:selected").val() != ""
						&&$(".choceMajoryt option:selected").val() == "") 
						{
					 alert("第一批志愿选择学校后至少选择一个专业！");
					return false; 
				}
				if ($(".choceMajorts option:selected").val() != "" 
						&& $("#tsxmschool option:selected").val() == "") {
					 alert("第一批志愿选择专业后必须选择一个学校！");
					return false; 
				}
				if ($(".choceMajoryt option:selected").val() != ""
						&& $("#yttcschool option:selected").val() == "") {
					 alert("第一批志愿选择专业后必须选择一个学校！");
					return false; 
				}
				//必须选择一个学校的判断
				var count = 0;//count的初始值等于不能选择的select的数
				//				console.log(count);
				$(".choceSchool").each(function() {
					if ($(this).val() != "" && $(this).val()!=null) {
					    count += 1;
					}
				})
			
				if (count < 1) {
					alert("未填志愿不能保存！！");
					return false;
				}
			
				
				$.ajax({
					type : 'POST',
					url : 'saveHighSchoolWish',
					//data : $("#ami_form").serialize(), //获取表单数据，select的name属性你自己加一下吧
					data : {
						//"bmh" : $("#bmh2").val(),
						"gzy10" : $("#tsxmschool option:selected").val(),
						//"ypcxxmc": $("#xxmc option:selected").text(),
						"gtszy" : $("#tsxmzy option:selected").val(),
						"gtszye" : $("#tsxmzy option:selected").text(),
						"gzy11" : $("#yttcschool option:selected").val(),
						"gytzy" : $("#yttczy option:selected").val(),
						"gytzye" : $("#yttczy option:selected").text(),
						"gylzy" : $("#yltzxx option:selected").val(),
						//"yltzxxmc": $("#yltzxx option:selected").text(),							
						"gzy21" : $("#second1 option:selected").val(),
						//"epcxxmc1": $("#second1 option:selected").text(),							
						"gzy22" : $("#second2 option:selected").val(),
						//"epcxxmc2": $("#second2 option:selected").text(),
						"gzy23" : $("#second3 option:selected").val(),
						//"epcxxmc3": $("#second3 option:selected").text(),
						"gzy24" : $("#second4 option:selected").val(),
						//"epcxxmc4": $("#second4 option:selected").text(),							
						"gzy31" : $("#third1 option:selected").val(),
						//"spcxxmc1": $("#third1 option:selected").text(),
						"gzy32" : $("#third2 option:selected").val(),
						//"spcxxmc2": $("#third2 option:selected").text(),
						"gzy33" : $("#third3 option:selected").val(),
						//"spcxxmc3": $("#third3 option:selected").text(),
						"gzy34" : $("#third4 option:selected").val(),
					//"spcxxmc4": $("#third4 option:selected").text()					
					},
					dataType : "json",
					success : function(data) {
						//alert("保存成功！");

						if (data.code == 'ok') {
							alert(data.message);
							window.location.href = data.url;
						} else if (data.code == 'error') {
							alert(data.message);
							window.location.href = data.url;
						} else {
							alert(data.message);
						}

					},
					error : function(error) {
						console.log(error);
						alert("保存失败");
					}
				})
			})

	/*第二、三批志愿A/B/C/D里面的学校不能重复*/

	$(".second_ami").on(
			"change",
			"select",
			function() {
				obj_this=$(this);
				var second1 = $("#second1").val();
				var second2 = $("#second2").val();
				var second3 = $("#second3").val();
				var second4 = $("#second4").val();
				console.log(second1 + ";" + second2 + ";" + second3 + ";"
						+ second4);
				if (second1 != "" && second2 != "" && second3 != ""
						&& second4 != "") {
					if (second1 == second2 || second1 == second3
							|| second1 == second4 || second2 == second3
							|| second4 == second2 || second3 == second4) {
						$(".checkrepeat21").removeClass("checkrepeat21")
								.addClass("checkrepeat2");
					} else {
						$(".checkrepeat2").removeClass("checkrepeat2").addClass(
								"checkrepeat21");
					}
				}
				if(second1 == "" || second2 == "" || second3 == ""
					|| second4 == ""){$(".checkrepeat2").removeClass("checkrepeat2").addClass(
					"checkrepeat21");}
			})

	$(".third_ami").on(
			"change",
			"select",
			function() {
				var third1 = $("#third1").val();
				var third2 = $("#third2").val();
				var third3 = $("#third3").val();
				var third4 = $("#third4").val();
				console.log("3："+third1 + ";" + third2 + ";" + third3 + ";"
								+ third4);
				if (third1 != "" && third2 != "" && third3 != ""
						&& third4 != "" &&third1 != null && third2 != null && third3 != null
							&& third4 != null) {
					if (third1 == third2 || third1 == third3
							|| third1 == third4 || third2 == third3
							|| third4 == third2 || third3 == third4) {
						$(".checkrepeat31").removeClass("checkrepeat31")
								.addClass("checkrepeat3");
					} else {
						$(".checkrepeat3").removeClass("checkrepeat3").addClass(
								"checkrepeat31");
					}
				}
				if (third1 == "" || third2 == "" || third3 == ""
					|| third4 == "")
					{
					$(".checkrepeat3").removeClass("checkrepeat3").addClass(
					"checkrepeat31");
					}
			})

	//如果学校是不可选的，则专业也不可选
	/* $(".choceSchool").each(function() {
		if ($(this).val() >= '1000') {
			$(this).siblings(".choceMajor").addClass("d");
			$(this).siblings(".choceMajor").attr("disabled", "disabled");
		}
	}) */

	/*中间部分为布文玉添加*/

	//点击编辑资料去掉disabled属性
	$('.updataInfo').on('click', function() {
		$('#ami_form').find('select').removeAttr('disabled')
	})

	//艺体、特色班级二选一,经确认，此部分不使用
	/*
	$('.teseClass').on('change', 'select', function() {
		var _this = this;
		var schoolval = $(_this).parent().find('.choceSchool').val();
		if (schoolval != '') {
			$('.yitiClass').find('select').attr('disabled', true).css({
				backgroundColor : "#7492ac"
			});
		} else {
			$('.yitiClass').find('select').attr('disabled', false).css({
				backgroundColor : "#005bab"
			});
		}
	})
	$('.yitiClass').on('change', 'select', function() {
		var _this = this;
		var schoolval = $(_this).parent().find('.choceSchool').val();
		if (schoolval != '') {
			$('.teseClass').find('select').attr('disabled', true).css({
				backgroundColor : "#7492ac"
			});
		} else {
			$('.teseClass').find('select').attr('disabled', false).css({
				backgroundColor : "#005bab"
			});
		}
	})
	 */
	/*
	$('#uploadInfo').on('click', function() {
		$.ajax({
			type : 'post',
			url : '',
			data : $("#ami_form").serialize(),//获取表单数据，select的name属性你自己加一下吧
			dataType : "json",
			success : function(data) {
				alert("提交数据");
				console.log(data);
				//返回成功后执行  
				$('#ami_form').find('select').attr('disabled', true);//禁用
			}
		})
	})
	 */

	/*2018-5-16 PY 加*/
	//首次进入获取学校
	var optionstr = '<option value="">--选择学校--</option>';
	var choceschool = $('.choceSchool');
	$.ajax({
		type : 'post',
		//url:"schoolData.json",//学校数据
		url : "wishOneTwoThreeSignUp?schoolId=" + $("#yttcschool").val(),
		dataType : 'json',
		success : function(data) {
			console.log(data);

			for (var i = 0, j = data.length; i < j; i++) {
				optionstr += '<option value="'+data[i].id+'">' + data[i].name
						+ '</option>'
			}
			$(".choceSchool").html(optionstr);
		}
	})


		$("#yttcschool").on("click",function(){  
		$("#yttcschool option").each(function () {   /*过滤指定select中重复的学校名 */
	        var getText = $(this).text();
	        if ($("#yttcschool option:contains(" + getText + ")").length > 1)   /*select option:contains("+text+")")包含text的个数 */ {
	            $("#yttcschool option:contains(" + getText + "):gt(0)").remove();  /*包含text大于个数0的选项就移除*/
	        }
	    });})
	    $("#tsxmschool").on("click",function(){ 
	    $("#tsxmschool option").each(function () {   /*过滤指定select中重复的学校名 */
	        var getText = $(this).text();
	        if ($("#tsxmschool option:contains(" + getText + ")").length > 1)   /*select option:contains("+text+")")包含text的个数 */ {
	            $("#tsxmschool option:contains(" + getText + "):gt(0)").remove();  /*包含text大于个数0的选项就移除*/
	        }
	    });})

	

	//点击select改变后
	choceschool.on('change', function() {
	    //alert(111)
		var _this = this;
		var thisId = $(_this).val();
		
		var thissibling = $(_this).siblings('select.choceMajor');
		var majorstr = '<option value="">--选择特色项目--</option>'
		var majorytstr = '<option value="">--选择艺体特长--</option>'
		thissibling.text("")
		//var values=$(_this).find("option:selected").val();
		//var values = $('#yttcschool option:selected').val();//选中的值
		var values = $(_this).find("option:selected").val();
		console.log(values);
		$.ajax({
			type : 'post',
			//url:"schoolData.json",
			url : "goGetHighSchoolMajor?schoolId=" + values, //取高中艺体特色专业
			dataType : 'json',
			success : function(data) {
				console.log(data);
				console.log(15);
				//级联获取专业

				/*  var thisdata =data[i]; */
				console.log(data)
				for (var k = 0, h = data.length; k < h; k++) {

					if (data[k].yttcdm != null && data[k].yttcdm != "null"
							&& data[k].yttcdm != "") {
						console.log("data[k].yttcmc=" + data[k].yttcmc)
						majorytstr += '<option value="'+data[k].yttcdm+'">'
								+ data[k].yttcmc + '</option>';
					}
					if (data[k].tsxmdm != null && data[k].tsxmdm != "null"
							&& data[k].yttcdm != "") {
						console.log("data[k].tsxmmc=" + data[k].tsxmmc)
						majorstr += '<option value="'+data[k].tsxmdm+'">'
								+ data[k].tsxmmc + '</option>';
					}

				}

				$(_this).siblings('select.choceMajor.ts').html(majorstr);
				$(_this).siblings('select.choceMajor.yt').html(majorytstr);
				/* var list=[];
				choceschool.each(function () {
				    var i=$(this).val()
				    if(i != ""){
				        list.push(i);
				    }
				    
				}) */

				//点击学校不重复
				/* var optionlist='<option value="">--选择学校--</option>';
				for(var f=0,k=data.length;f<k;f++){
				    var id=data[f].id.toString();
				    if(list.indexOf(id)=="-1"){
				        optionlist +='<option value="'+data[f].id+'">'+data[f].name+'</option>'
				    }

				}
				if(thisId == ""){
				    $(_this).addClass('csd')
				}else {
				    $(_this).removeClass('csd')
				} */
				/*  $(".choceSchool.csd").html(optionlist) */
			},
			error : function(error) {
				console.log(error);
			}
		})
		/*       
			//测试
			$(".schoolId").change(function){
				$(".tsxmdm_id").empty();
				var option=$("<option>").val(1).text("xx");
				$(".tsxmdm_id").append(option);
			}
		 */
	});

	//数据判读完成后，提交数据
	// $('#tese_form').submit();
</script>
</html>
